USE [GraduateWork]
GO

/****** Object:  Table [dbo].[Problem]    Script Date: 02/10/2010 22:01:24 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[Problem](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Type] [int] NOT NULL,
	[InputParametersId] [int] NOT NULL,
	[SolutionId] [int] NOT NULL,
	[ExactSolutionId] [int] NOT NULL,
 CONSTRAINT [PK_Problem] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[Problem]  WITH CHECK ADD  CONSTRAINT [FK_Problem_InputParameters] FOREIGN KEY([InputParametersId])
REFERENCES [dbo].[InputParameters] ([Id])
GO

ALTER TABLE [dbo].[Problem] CHECK CONSTRAINT [FK_Problem_InputParameters]
GO

ALTER TABLE [dbo].[Problem]  WITH CHECK ADD  CONSTRAINT [FK_Problem_Solution] FOREIGN KEY([SolutionId])
REFERENCES [dbo].[Solution] ([Id])
GO

ALTER TABLE [dbo].[Problem] CHECK CONSTRAINT [FK_Problem_Solution]
GO

ALTER TABLE [dbo].[Problem]  WITH CHECK ADD  CONSTRAINT [FK_Problem_ExactSolution] FOREIGN KEY([ExactSolutionId])
REFERENCES [dbo].[Solution] ([Id])
GO

ALTER TABLE [dbo].[Problem] CHECK CONSTRAINT [FK_Problem_ExactSolution]
GO


